#pragma once

#include "cfs.h"
#include "rt.h"
#include "deadline.h"

struct task_struct;

struct rq_flags
{
    unsigned long flags;
    struct pin_cookie cookie;
};

struct rq
{
    u64 clock_pelt;
    unsigned long lost_idle_time;

    /* runqueue lock: */
    raw_spinlock_t __lock;
    unsigned int ttwu_pending;

    u64 nr_switches;

    union
    {
        struct task_struct __rcu *donor; /* Scheduler context */
        struct task_struct __rcu *curr;  /* Execution context */
    };
    u64 clock_task;
    u64 clock;
    u64			idle_stamp;
    unsigned long next_balance;
    int clock_update_flags;
    int cpu;
    unsigned int nr_running;
    int online;

    struct cfs_rq cfs;
    struct rt_rq rt;
    struct dl_rq dl;
    struct task_struct *idle;

    struct sched_dl_entity fair_server;

    struct sched_dl_entity *dl_server;
    struct balance_callback *balance_callback;

    struct list_head cfs_tasks;

    struct root_domain *rd;
    struct sched_domain *sd;
};
